<?php

// ini_set("display_errors", "On");
// error_reporting(E_ALL);

require_once '../../../base/header-iframe.php';

require_once '../../../../sql/connection.php';

$jobID = $_POST['jobID'];
$stuID = $_POST['stuID'];
$score = $_POST['score'];

$updateSql = "UPDATE `student-job` SET score = '$score' WHERE stu_ID = '$stuID' AND job_ID = '$jobID' ";


if (mysqli_query($GLOBALS['conn'], $updateSql)) {
	echo "
            <script>
                alert('给分成功！');
                window.location.href=document.referrer;
            </script>
        ";
} else {
	echo "
            <script>
                alert('给分失败！');
                history.back();
            </script>
        ";
}
	
